package com.yang.concurrency.chapter5;

import java.util.stream.IntStream;

/**
 * @Author: 血魔i
 * @Date: Created in 15:49 2021/12/12
 * @Version: $
 */
public class ThreadJoin {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            try{
                IntStream.range(1, 1000).forEach(i->System.out.println(Thread.currentThread().getName()+" 陈瑾玉->" + i));
                Thread.sleep(2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }, "陈瑾玉");
        t1.start();
        t1.join();
        IntStream.range(1, 100)
                .forEach(i -> System.out.println(Thread.currentThread().getName()+"杨兴卓->" + i));
    }
}
